package com.tocea.formation.rents;

import java.util.Date;
import com.tocea.formation.books.IBook;
import com.tocea.formation.others.Dates;
import com.tocea.formation.users.IUser;


public class Rent implements IRent
{
    
    private IUser user;
    private IBook book;
    private Date startDate;
    private boolean isReturn;
    private Date returnDate;
    private Integer id;
    
    

    public Rent(IUser user, IBook book, Integer _id) {
    
        super();
        this.user = user;
        this.book = book;

       startDate = new Date();
       isReturn = false;
       id = _id;

    }

    public IUser getUser() {
    
        return user;
    }
    
    public IBook getBook() {
    
        return book;
    }
    
    public Date getStartDate() {
    
        return startDate;
    }
    
    public void setStartDate(Date date){
    	this.startDate = date;
    }
    public void setStartDate(String Date) {
    	this.startDate = Dates.stringToDate(Date);
    }

    public boolean isReturn() {
    
        return isReturn;
    }
    public void returned(boolean returned){
    	this.isReturn = returned;
    }
    public Date getReturnDate() {
    
        return returnDate;
    }

    public void setreturnDate(Date _returnDate) {
    
        returnDate = _returnDate;
        isReturn = true;
        
    }

    public void setreturnDate(String _date){
    	this.returnDate = Dates.stringToDate(_date);
    }
    public Integer getId() {
        return id;
    }
    
}
